package server.world.character

import server.world._
import server.world.map._
import server.world.action._


//Object responsible for giving NPC commands
//Needs API for scripts to work
object AI{
  
var NPCList:List[NPC] = List()

def giveComands{
  for (npc <- NPCList)  if(npc.isabletoAct) TurnProcessor.addAction(npc.getAction())
}
	
def addNPC(npc:NPC){
  NPCList = npc :: NPCList
  TurnProcessor.addCharacter(npc)
} 

def removeNPC(npc:NPC){
  def pred(e1:NPC):Boolean = (e1 != npc)
  NPCList = NPCList.filter(pred)
}

}
